<template>
	<view>
		<view class="list">发布后将通知所有成员</view>
		<view class="texts">
			<textarea class="textsa" placeholder="输入公告内容..." v-model='content'></textarea>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				content:''
			}
		},
		onLoad(options){
			this.group_id = options.group_id;
		},
		onShow(){
			this.$msgchat.initwork();
		},
		methods: {
			//初始化数据
			initDat(){
				var obj = {
					token: uni.getStorageSync('token'),
					group_id:this.group_id,
					content:this.content
				}
				this.$common.requests('/api/Group/editgroupnotice', obj).then(res => {
					console.log(res)
					if(res.data.code==1){
						this.$api.msg(res.data.msg);
						setTimeout(() => {
							uni.navigateTo({
								url: '/pages/groupDetails/groupDetails?group_id='+this.group_id
							})
						}, 800)
					}else{
						this.$api.msg(res.data.msg);
						return;
					}
					
				})
			}
		},
		onNavigationBarButtonTap(e) {
			this.initDat();
		}
	}
</script>

<style>
	page {
		background: #F5F4F9;
	}
	.list{
		padding: 35upx 30upx;
		color: #787878;
	}
	.texts{
		padding: 35upx 30upx;
		height: 40%;
		background: #FFF;
	}
	.textsa{
		width: 100%;
	}
</style>
